/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function viewDetail(element){
    var nodeProduct = element.parentNode.parentNode;
    var id = nodeProduct.getElementsByClassName("productID")[0].innerHTML;
    location.href = "Controller?btnAction=viewdetail&id=" + id;
}

function comment(productID)
{
    var xmlhttp;
    var ajaxComment = document.getElementById("commentContent").value;
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            document.getElementById("commentContent-show").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","Controller?btnAction=commentAjax&comment="+ajaxComment+"&productid=" + productID,true);
    xmlhttp.send();
}
